const EventEmitter = require("events");
let e = new EventEmitter()

//只会触发一次
e.once('click',()=>{
  console.log('click');
})

e.emit('click')
e.emit('click')